package com.studyhub.api.problem.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.studyhub.api.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 标签实体类
 * 
 * @author StudyHub Team
 */
@Getter
@Setter
@TableName("pr_tag")
@Schema(name = "Tag", description = "标签信息")
public class Tag extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "标签ID")
    private Long id;

    @NotBlank(message = "标签名称不能为空")
    @Size(max = 50, message = "标签名称长度不能超过50字符")
    @Schema(description = "标签名称")
    private String name;

    @Size(max = 255, message = "标签描述长度不能超过255字符")
    @Schema(description = "标签描述")
    private String description;

    @Schema(description = "标签颜色")
    private String color = "#1890ff";

    @Schema(description = "使用次数")
    private Integer useCount = 0;

    @Schema(description = "状态：0-禁用，1-启用")
    private Integer status = 1;

    @TableLogic
    @Schema(description = "逻辑删除：0-未删除，1-已删除")
    private Integer deleted = 0;
}
